﻿using SLClient.CustomerControls;
using SLClient.Extension;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace SLClient.Views
{
    public partial class Nx3DView : Page
    {
        public int lotteryCatagoryId;
        public Nx3DView()
        {
            PlayDataInfo sdData;
            this.lotteryCatagoryId = 2;
            this.InitializeComponent();
            if (!IsolatedStorageHelper<PlayDataInfo>.IsSettingPersisted("sd"))
            {
                sdData = new PlayDataInfo(this.lotteryCatagoryId, "sd");
            }
            else if (ViewDispatcher.SdData.CurrentPlayData.OpenTime <= DateTime.Now)
            {
                sdData = new PlayDataInfo(this.lotteryCatagoryId, "sd");
            }
            else
            {
                sdData = ViewDispatcher.SdData;
            }
            BonusControl bonuscontrol = new BonusControl(sdData);
            this.gridUp.Children.Add(bonuscontrol);
            bonuscontrol.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)0);
            bonuscontrol.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            LastOpenDataControl control2 = new LastOpenDataControl(sdData);
            this.gridUp.Children.Add(control2);
            control2.SetValue(Grid.ColumnProperty, 1);
            control2.SetValue(FrameworkElement.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
            Top10WinnerControl control3 = new Top10WinnerControl(sdData);
            this.gridDown.Children.Add(control3);
            control3.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)2);
            control3.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            control3.SetValue(Grid.ColumnProperty, 1);
            this.m_BetControl.InitPage(new string[] { "百位", "十位", "个位" }, new BetPlayTypeInfo[] { new BetPlayTypeInfo(0x12, "不定位", new BetPlayInfo[] { new BetPlayInfo(0x37, "后一", 2, 1, 1, 2, false), new BetPlayInfo(0x38, "后二", 2, 1, 1, 1, false), new BetPlayInfo(0x39, "三星", 2, 1, 1, 0, false) }) }, bonuscontrol, this.lotteryCatagoryId);
        }

    }
}
